M

Ceiling.Create

Description:
Creates a new instance of ceiling within the project.
Remarks:
To validate curve loop profile use BoundaryValidation.
Overloads (2):
Create(Document,IList[CurveLoop],ElementId,ElementId)
public static Ceiling Create(
	Document document,
	IList<CurveLoop> curveLoops,
	ElementId ceilingTypeId,
	ElementId levelId
)
Return Value Ceiling If successful a new ceiling object within the project.
Ceiling CreateCeilingAtElevation(Document document, Level level, double elevation)
{
   XYZ first = new XYZ(0, 0, 0);
   XYZ second = new XYZ(20, 0, 0);
   XYZ third = new XYZ(20, 15, 0);
   XYZ fourth = new XYZ(0, 15, 0);
   CurveLoop profile = new CurveLoop();
   profile.Append(Line.CreateBound(first, second));
   profile.Append(Line.CreateBound(second, third));
   profile.Append(Line.CreateBound(third, fourth));
   profile.Append(Line.CreateBound(fourth, first));

   var ceiling = Ceiling.Create(document, new List<CurveLoop> { profile }, ElementId.InvalidElementId, level.Id);
   Parameter param = ceiling.get_Parameter(BuiltInParameter.CEILING_HEIGHTABOVELEVEL_PARAM);
   param.Set(elevation);

   return ceiling;
}